package com.example.onlinejudge.config;

import com.example.onlinejudge.controller.CommandUtilController;
import com.example.onlinejudge.controller.TaskController;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.io.IOException;

@ControllerAdvice(assignableTypes = {CommandUtilController.class, TaskController.class})
public class CommandUtilExceptionAdvice {
    @ExceptionHandler(IOException.class)
    public void ioExceptionAdvice(IOException e){
        e.printStackTrace();
    }
    @ExceptionHandler(InterruptedException.class)
    public void interruptedExceptionAdvice(InterruptedException e){
        e.printStackTrace();
    }
}
